package cn.helele.remoteurl;

import cn.helele.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @FeignClient value属性用于指定服务名称
 * fallback属性用于指定编写的失败处理函数类
 */
@FeignClient(value = "application-provider-user",fallback = UserFeignClientFallback.class)
public interface UserFeignClient {

    // Feign会根据注解帮我们生成URL
    @GetMapping("/user/{id}")
    User queryUserById(@PathVariable("id") int id);
}
